
#include <BScaleChannel>
#include "member_BScaleChannel.h"

using namespace BWE;

#define member					(*(member_BScaleChannel*)_ptr)
#define member_allocate()		_ptr = new member_BScaleChannel(this)
#define member_release()		delete (member_BScaleChannel*)_ptr

BScaleChannel::BScaleChannel()
{
	member_allocate();
}
BScaleChannel::~BScaleChannel()
{
	member_release();
}

void BScaleChannel::addKeyframe(float time, const BVector& scale)
{
	BVectorKeyframe keyframe(time, scale);
	member.keyframes.append(keyframe);
}
void BScaleChannel::addKeyframe(const BVectorKeyframe& keyframe)
{
	member.keyframes.append(keyframe);
}

int BScaleChannel::keyframeCount() const
{
	return member.keyframes.size();
}
const BVectorKeyframe& BScaleChannel::keyframe(int index) const
{
	return member.keyframes(index);
}

bool BScaleChannel::insertKeyframe(float time)
{
	int pos = member.sampler->indexOf(member.keyframes, time);
	return member.keyframes.insert(pos, BVector());
}
bool BScaleChannel::removeKeyframe(float time)
{
	int index = member.sampler->indexOf(member.keyframes, time);
	return member.keyframes.remove(index);
}

bool BScaleChannel::accept(BObject* object)
{
	BNode* node = dynamic_cast<BNode*>(object);
	if (node)
		return true;
	return false;
}
void BScaleChannel::apply(BObject* object)
{

}
void BScaleChannel::fresh(double time)
{

}
